

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using JTC.MiniCommerce.Core;
using JTC.MiniCommerce.Localization;
using SubSonic.Utilities;

namespace JTC.MiniCommerce.Web.admin {
  public partial class orderedit : System.Web.UI.Page {

    #region Member Variables

    private int orderId = 0;
    private string view = string.Empty;

    #endregion

    #region Page Events

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e) {
      try {
        orderId = Utility.GetIntParameter("orderId");
        view = Utility.GetParameter("view");
        SetOrderEditProperties();
        switch (view) {
          case "r":
            receipt.Visible = true;
            break;
          case "t":
            transaction.Visible = true;
            break;
          case "a":
            actions.Visible = true;
            break;
          case "s":
            shipping.Visible = true;
            break;
          case "n":
            notes.Visible = true;
            break;
          default:
            receipt.Visible = true;
            break;
        }
      }
      catch (Exception ex) {
        Logger.Error(typeof(orderedit).Name + ".Page_Load", ex);
        Master.MessageCenter.DisplayCriticalMessage(LocalizationUtility.GetCriticalMessageText(ex.Message));
      }
    }

    #endregion

    #region Methods

    #region Private

    /// <summary>
    /// Sets the order edit properties.
    /// </summary>
    private void SetOrderEditProperties() {
      LocalizationUtility.AddLabelText(lblOrderEdit);
    }

    #endregion

    #endregion

  }
}
